home *** CD-ROM | disk | FTP | other *** search
/ The PC-SIG Library 10 / The PC-Sig Library - Shareware for the IBM PC and Compatibles (PC-SIG)(Tenth Edition Disks 1-2804)(1991).iso / PC_SIGCD / 04 / 1 / DISK0416.ZIP / ROFF4A.C < prev    next >
Text File  |  1985-08-08  |  310b  |  16 lines

  1. atoi(s)
  2. char s[];
  3.       int i,n,sign;
  4.       for (i=0;s[i]==' ' || s[i]=='\n' || s[i]=='\t';i++) ;
  5.       sign=1;
  6.       if (s[i]=='+' || s[i]=='-')
  7.             sign=(s[i++]=='+') ? 1 : -1;
  8.       for (n=0; s[i] >= '0' && s[i] <= '9'; i++)
  9.             n=10*n+s[i]-'0';
  10.       return(sign*n);
  11. }
  12.  
  13.  
  14.  
  15.